package com.example.shopingcenter.util;

import android.content.Context;
import android.content.SharedPreferences;

public class PreferenceManager {

    private static final String PREF_NAME = "AppPreferences";
    private static final String PREF_FIRST_TIME_LOGIN = "isFirstTimeLogin";

    private SharedPreferences sharedPreferences;

    public PreferenceManager(Context context) {
        sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
    }

    public boolean isFirstTimeLogin() {
        return sharedPreferences.getBoolean(PREF_FIRST_TIME_LOGIN, true);
    }

    public void setFirstTimeLogin(boolean isFirstTime) {
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putBoolean(PREF_FIRST_TIME_LOGIN, isFirstTime);
        editor.apply();
    }
}
